﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using You.Niao.ShaFa.IDAL;
using You.Niao.ShaFa.Model;
using DBUtility;
using Common.Base;
using System.Collections.Generic;


namespace You.Niao.ShaFa.DAL
{
    public class AreaDAL:SqlConn,IArea
    {
        public List<area> GetList(string fid)
        {
            List<area> list = new List<area>();
            SqlParameter[] pars = { new SqlParameter("@FID",fid)};

            using (SqlDataReader dr = DbHelperSQL.ExecuteReader(ShaFaConn, "select name from area where FID=@FID",pars))
            {
                 while(dr.Read())
                 {
                     area model = new area();
                     model.name = dr["name"].ToString();
                     list.Add(model);
                     //model.name = dr.IsDBNull(0) ? "" : dr["name"].ToString();
                 }
            }
            return list;
        }
    }
}
